/*
 * @Author: pengtianrui 2276608413@qq.com
 * @Date: 2024-08-26 15:43:52
 * @LastEditors: 武兴创 superjava@vip.qq.com
 * @LastEditTime: 2024-08-28 17:47:31
 * @FilePath: \SGFEM\DataStructure\FEM\Constraint\src\RBE1Data.cpp
 */
#include "DataStructure/Input/Constraint/RBE1Data.h"

#include "DataStructure/Common/Validation.h"

using namespace SG::DataStructure;

bool SG::DataStructure::FEM::operator== (const RBE1Data::DEP& lhs, const RBE1Data::DEP& rhs)
{
    if (lhs.m_gm != rhs.m_gm)
    {
        return false;
    }
    if (lhs.m_cm != rhs.m_cm)
    {
        return false;
    }
    return true;
}

bool SG::DataStructure::FEM::operator== (const RBE1Data::INDEP& lhs, const RBE1Data::INDEP& rhs)
{
    if (lhs.m_gn != rhs.m_gn)
    {
        return false;
    }
    if (lhs.m_cn != rhs.m_cn)
    {
        return false;
    }
    return true;
}

/// @brief 判断两个RBE1Data是否相等
/// @param lhs
/// @param rhs
/// @return
bool SG::DataStructure::FEM::operator== (const RBE1Data& lhs, const RBE1Data& rhs)
{
    if (lhs.m_id != rhs.m_id)
    {
        return false;
    }
    if (lhs.m_indepList != rhs.m_indepList)
    {
        return false;
    }
    if (lhs.m_depList != rhs.m_depList)
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (lhs.m_alpha, rhs.m_alpha))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (lhs.m_refTemperature, rhs.m_refTemperature))
    {
        return false;
    }
    if (lhs.m_domainId != rhs.m_domainId)
    {
        return false;
    }
    return true;
}
